﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tommy
{
    public partial class UIBrowser : FormEx,IUIBrowser
    {
        delegate void FormEvent();
        
        public UIBrowser()
        {
            InitializeComponent();
        }        

        public void CloseEx()
        {
            if (this.InvokeRequired)
            {
                FormEvent closeHappend = new FormEvent(Close);
                Invoke(closeHappend);
            }
            else
            {
                base.Close();
            }
        }

        public void ShowEx()
        {
            if (this.InvokeRequired)
            {
                FormEvent showHappend = new FormEvent(Close);
                Invoke(showHappend);
            }
            else
            {
                
                Show();
            }
        }
    }
}
